package cn.taobaoke.restful.service;

import cn.taobaoke.restful.domain.UserGroupRelation;
import cn.taobaoke.restful.domain.UserGroupRelationRepository;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author yangzuo
 * @since 2017-03-21
 */
@Service
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class UserGroupRelationService {

    public UserGroupRelation addUserToGroup(final UserGroupRelation userGroupRelation, final Long domainId) {
        userGroupRelation.setDomainId(domainId);
        return userGroupRelationRepository.save(userGroupRelation);
    }

    private final @NonNull
    UserGroupRelationRepository userGroupRelationRepository;
}
